package com.ybu.controller;

import com.ybu.common.R;
import com.ybu.pojo.vo.ProductCategoryVO;
import com.ybu.service.ProductCategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("api/category")
public class ProductCategoryController {
    @Autowired
    private ProductCategoryService productCategoryService;
    @GetMapping("list")
    public R<List<ProductCategoryVO>> getCategoryList(){
        List<ProductCategoryVO> categoryList = productCategoryService.getCategoryList();
        return R.ok(categoryList);
    }

}
